home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-09-18 | 9.7 KB | 386 lines | [TEXT/ttxt] |
- Scripts of Stripped Library
-
- Statistics of the Stack
-
- Contains 2 cards.
- Contains 2 backgrounds.
-
- Script of stack
-
- on doMenu theItem
- if theItem is "First" then go to first card of this background
- else
- if theItem is "Next" then go to next card of this background
- else
- if theItem is "Prev" then go to previous card of this background
- else
- if theItem is "Last" then go to last card of this background
- else pass doMenu
- end if -- else Last
- end if -- else Prev
- end if -- else Next
- end doMenu
-
- on arrowKey whichArrow
- if whichArrow is right then go to next card of this background
- else
- if whichArrow is left then go to previous card of this background
- else pass arrowKey
- end if
- end arrowKey
-
-
- Script of Background "Books"
-
- on opencard
- if field "By Whom" is empty then
- hide background button "Return the Book"
- set locktext of field "By Whom" to false
- else
- show background button "Return the Book"
- set locktext of field "By Whom" to true
- end if
- end opencard
-
- on closecard
- hide message box
- repeat with index = 1 to 4
- set locktext of field index to true
- end repeat
- end closecard
-
- on doMenu theItem
- Global OK
- if OK is true then pass doMenu
- else -- (OK is false)
- if theItem is "New Card" then
- if field "title" is empty then answer "Not while this card is empty."
- else pass doMenu
- else pass doMenu
- end if
- end doMenu
-
-
- Script of Background "Index"
-
- on doMenu theItem
- if theItem is "Delete Card" then
- answer "Delete an entire index card?"with "OK" or "Cancel"
- if it is "OK"
- then pass doMenu
- else exit doMenu
- else if theItem is "Cut Card" or theItem is "Paste Card" then
- answer "Sorry, not with the index."
- else pass doMenu
- end doMenu
-
- on mouseUp
- visual barn door open
- get the short name of target
- go to card it
- end mouseUp
-
-
- Script(s) of Background Field(s) of background # "Books"
-
- Script of Background Field #1: bkgnd field "Title"
- on closefield
- if the length of field "title" > 30 then
- answer "Sorry, there is a 30 character title limit."
- exit closefield
- end if
- put field 1 into title
- set the name of this card to title
- pass closefield
- end closefield
-
- Script of Background Field #5: bkgnd field "By Whom"
- on closefield
- if field "By Whom" <> "" then
- set locktext of field "By whom" to true
- put the date into field date
- convert the date to dateItems
- put item 1 of it into year
- put item 2 of it into month
- put item 3 of it into day
- subtract 1900 from year
- if month <> 12 then
- add 1 to month
- else
- put 1 into month
- add 1 to year
- end if
- put month & "/" & day & "/" & year into theDueDate
- put theDueDate into field duedate
- show background button "Return the Book"
- end if
- end closefield
-
-
- Script(s) of Background Button(s) of background “Books”
-
- Script of Background Button #1: bkgnd button "Prev"
- on mouseUp
- visual effect wipe right
- go to previous card of this background
- end mouseUp
-
-
- Script of Background Button #2: bkgnd button "Next"
- on mouseUp
- visual effect wipe left
- go to next card of this background
- end mouseUp
-
-
- Script of Background Button #3: bkgnd button "Home"
- on mouseUp
- visual effect iris open
- go Home
- end mouseUp
-
-
- Script of Background Button #4: bkgnd button "Find"
- on mouseUp
- domenu find...
- end mouseUp
-
-
- Script of Background Button #5: bkgnd button "first Card"
- on mouseUp
- visual barn door open
- go to first card of this background
- end mouseUp
-
-
- Script of Background Button #6: bkgnd button "Last Card"
- on mouseUp
- visual barn door close
- go to last card of this background
- end mouseUp
-
-
- Script of Background Button #7: bkgnd button "Sort"
- on mouseUp
- Global OK
- put true into OK -- OK to doMenu New Card
- set lockscreen to true
- sort by field "title"
- choose button tool
- go to first card of background "books"
- put the number of this card into begin
- put begin into targetCard
- hide background button "add to index"
- repeat with counter = begin to number of cards
- put 100 + counter mod 8 into cursorNum
- set cursor to cursorNum
- go to card targetCard
- add 1 to targetCard
- put the short name of this card into nameHolder
- put (counter - begin) div 12 + 1 into CardNum
- put (counter - begin) mod 12 + 1 into ButtonNum
- go to card CardNum
- get short name of background
- if it is "Index" then
- if number of buttons >= buttonNum then
- set name of button buttonNum to nameHolder
- else -- (Number of buttons is less than buttonNum)
- if number of buttons < 12 then
- put number of buttons into lastButton
- get location of button lastButton
- put item 1 of it into horiz
- put item 2 of it into vert
- drag from horiz,vert to horiz,vert+21 with optionKey
- add 1 to lastButton
- set the name of button lastButton to nameHolder
- end if -- number of buttons < 12
- end if -- number of buttons >= buttonNum
- else -- (background is not "Index")
- go to last card of background "Index"
- click at loc of button 1
- doMenu copy button
- doMenu New Card
- doMenu Paste Button
- set the name of button 1 to nameHolder
- add 1 to targetCard
- end if -- it is "Index"
- end repeat
- choose browse tool
- go to first card of background "Index"
- set lockscreen to false
- put false into OK
- end mouseUp
-
-
- Script of Background Button #8: bkgnd button "Add a New Book"
- on mouseUp
- domenu new card
- repeat with index = 1 to 4
- set locktext of field index to false
- end repeat
- show background button "Add to Index"
- type tab
- end mouseUp
-
-
- Script of Background Button #9: bkgnd button "Return the Book"
- on mouseUp
- set locktext of field "By whom" to false
- put empty into field "by whom" -- null
- put empty into field date -- null
- put empty into field duedate -- null
- hide background button "Return the Book"
- end mouseUp
-
-
- Script of Background Button #10: bkgnd button "Look at all"
- on mouseUp
- show all cards
- end mouseUp
-
-
- Script of Background Button #11: bkgnd button "Modify Data"
- on mouseUp
- repeat with index = 1 to 4
- set locktext of field index to false
- end repeat
- type tab
- end mouseUp
-
-
- Script of Background Button #12: bkgnd button "Add to Index"
- on mouseUp
- put field 1 into title
- set the name of this card to title
- push this card
- set lockscreen to true
- go to last card of background "Index"
- set the userLevel to 4
- choose button tool
- if number of buttons < 12 then
- put number of buttons into ButtonNum
- get loc of button ButtonNum
- put item 1 of it into horiz
- put item 2 of it into vert
- drag from horiz,vert to horiz,vert+21 with optionKey
- add 1 to buttonNum
- set the name of button buttonNum to title
- else
- click at loc of button 1
- doMenu copy button
- doMenu New Card
- doMenu paste button
- set the name of button 1 to title
- end if
- choose browse tool
- set the userLevel to 2
- pop card
- set lockscreen to false
- hide background button "Add to Index"
- end mouseUp
-
-
- Script of Background Button #13: bkgnd button "Index"
- on mouseUp
- visual barn door close
- go to background index
- end mouseUp
-
-
- Script(s) of Background Button(s) of background “Index”
-
- Script of Background Button #1
- on mouseUp
- visual effect iris open
- go Home
- end mouseUp
-
-
- Script of Background Button #2: bkgnd button "first Card"
- on mouseUp
- visual iris close
- go to first card of this background
- end mouseUp
-
-
- Script of Background Button #3: bkgnd button "Prev"
- on mouseUp
- visual effect wipe down
- go to previous card of this background
- end mouseUp
-
-
- Script of Background Button #4: bkgnd button "Next"
- on mouseUp
- visual effect wipe up
- go to next card of this background
- end mouseUp
-
-
- Script of Background Button #5: bkgnd button "Last Card"
- on mouseUp
- visual iris open
- go to last card of this background
- end mouseUp
-
-
- Script of Background Button #6: bkgnd button "Find"
- on mouseUp
- domenu find...
- end mouseUp
-
-
- Script of Background Button #7: bkgnd button "Look at all"
- on mouseUp
- show all cards
- end mouseUp
-
-
- Script of Background Button #8: bkgnd button "Sort"
- on mouseUp
- global level
- set lockscreen to true
- sort by field "title"
- choose button tool
- go to first card of background "books"
- put the number of this card into begin
- put begin into targetCard
- hide background button "add to index"
- repeat with counter = begin to number of cards
- put 100 + counter mod 8 into cursorNum
- set cursor to cursorNum
- go to card targetCard
- add 1 to targetCard
- put the short name of this card into nameHolder
- put (counter - begin) div 12 + 1 into CardNum
- put (counter - begin) mod 12 + 1 into ButtonNum
- go to card CardNum
- get short name of background
- if it is "Index" then
- if number of buttons >= buttonNum then
- set name of button buttonNum to nameHolder
- else -- (Number of buttons is less than buttonNum)
- if number of buttons < 12 then
- put number of buttons into lastButton
- get location of button lastButton
- put item 1 of it into horiz
- put item 2 of it into vert
- drag from horiz,vert to horiz,vert+21 with optionKey
- add 1 to lastButton
- set the name of button lastButton to nameHolder
- end if -- number of buttons < 12
- end if -- number of buttons >= buttonNum
- else -- (background is not "Index")
- go to last card of background "Index"
- click at loc of button 1
- doMenu copy button
- doMenu New Card
- doMenu Paste Button
- set the name of button 1 to nameHolder
- add 1 to targetCard
- end if -- it is "Index"
- end repeat
- choose browse tool
- go to first card of background "Index"
- set lockscreen to false
- end mouseUp